package com.yang;

import com.yang.yangLoad.DataLoader;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;

public class Demo implements Listener{
    private Main main;

    private DataLoader dataLoader;
    public Demo(Main main, DataLoader dataLoader) {
        this.main = main;
        this.dataLoader = dataLoader;
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        FileConfiguration config = main.getConfig();
        String string = config.getString("monster.monster1.name");
        main.getLogger().info("僵尸名字： " + string + "================");
        main.getLogger().info("这是demo ===========");
        // 玩家加入服务器时触发的逻辑
        main.getLogger().info("玩家 " + event.getPlayer().getName() + " 加入了服务器！");
        main.getLogger().info("这是dataLaderName" + dataLoader.getData().getString("name") + " ===============");
    }

}
